﻿<div ng-controller="app.views.home as vm">
    <div class="row">
        <div class="col-sm-6">
            <h3>Notification Test Form (sending email)</h3>
            <p>For a better test, register a second user, login in a different browser and send emails between users.</p>
            <form>
                <div class="form-group">
                    <label>Username</label>
                    <input type="text" class="form-control" ng-model="vm.sendEmailArgs.userName" />
                </div>
                <div class="form-group">
                    <label>Subject</label>
                    <input type="text" class="form-control" ng-model="vm.sendEmailArgs.subject" />
                </div>
                <div class="form-group">
                    <label>Body</label>
                    <textarea class="form-control" ng-model="vm.sendEmailArgs.body"></textarea>
                </div>
                <div class="form-group">
                    <input type="checkbox" ng-model="vm.sendEmailArgs.sendNotification" />
                    Send a notification for this email
                </div>
                <button class="btn btn-primary" ng-click="vm.sendEmail()">Send!</button>
            </form>
        </div>

        <div class="col-sm-6">
            <h3>Incoming Notifications</h3>
            <div ng-repeat="userNotification in globalUserNotifications" style="border-top: 1px solid #CCC;">
                <p>
                    {{vm.formatNotificationMessage(userNotification)}} <br />
                    <span class="text-muted">{{userNotification.notification.creationTime}}</span>
                </p>
            </div>
        </div>
    </div>
</div>